<template>
  <div class="login-container">
    <div class="header">
      <el-form
        :inline="true"
        :model="formInline"
        class="demo-form-inline"
      >
        <el-form-item label="虚拟号码：">
          <el-input
            v-model="input"
            placeholder="请输入内容"
          />
        </el-form-item>
        <el-form-item label="员工手机号">
          <el-input
            v-model="input1"
            placeholder="请输入内容"
          />
        </el-form-item>
        <el-form-item label="绑定状态">
          <el-select
            v-model="value"
            placeholder="请选择"
          >
            <el-option
              v-for="item in options"
              :key="item.value"
              :label="item.label"
              :value="item.value"
            />
          </el-select>
        </el-form-item>
        <el-form-item label="运营商">
          <el-select
            v-model="value"
            placeholder="请选择"
          >
            <el-option
              v-for="item in options"
              :key="item.value"
              :label="item.label"
              :value="item.value"
            />
          </el-select>
        </el-form-item>
        <el-form-item>
          <el-button
            type="text"
            icon="el-icon-search"
          >查找</el-button>
        </el-form-item>
        <el-form-item>
          <el-button
            type="text"
            icon="el-icon-close"
          >清空</el-button>
        </el-form-item>
      </el-form>
    </div>
    <div class="box">
      <el-row>

        <el-col :span="24">
          <el-table
            ref="multipleTable"
            tooltip-effect="dark"
            :data="tableData"
            style="width: 100%"
            :row-class-name="tableRowClassName"
            @selection-change="handleSelectionChange"
          >
            <el-table-column
              type="selection"
              width="55"
            />
            <el-table-column
              prop="date"
              label="地市"
              align="center"
            />
            <el-table-column
              label="表格展开"
              align="center"
              type="expand"
            >
              <template slot-scope="props">
                <el-table
                  :data="tableData"
                  border
                  style="width: 100%"
                >
                  <el-table-column
                    prop="date"
                    label="日期"
                    width="180"
                  />
                  <el-table-column
                    prop="name"
                    label="姓名"
                    width="180"
                  />
                  <el-table-column
                    prop="address"
                    label="地址"
                  />
                </el-table>
              </template>
            </el-table-column>
            <el-table-column
              label="下拉菜单"
              align="center"
            >
              <i class="el-icon-arrow-down" />
              <template slot-scope="scope">
                <el-dropdown>
                  <span class="el-dropdown-link">
                    下拉菜单
                  </span>
                  <el-dropdown-menu slot="dropdown">
                    <el-dropdown-item>黄金糕</el-dropdown-item>
                    <el-dropdown-item>狮子头</el-dropdown-item>
                    <el-dropdown-item>螺蛳粉</el-dropdown-item>
                    <el-dropdown-item disabled>双皮奶</el-dropdown-item>
                    <el-dropdown-item divided>蚵仔煎</el-dropdown-item>
                  </el-dropdown-menu>
                </el-dropdown>
              </template>

            </el-table-column>
            <el-table-column
              prop="name"
              label="员工手机号"
              align="center"
            />
            <el-table-column
              prop="name"
              label="虚拟号"
              align="center"
            />
            <el-table-column
              prop="name"
              label="最后变更日期"
              align="center"
            />
            <el-table-column
              prop="name"
              label="当前绑定/解绑状态"
              align="center"
            />
            <el-table-column
              prop="address"
              label="运营商"
              align="center"
            />
            <el-table-column
              fixed="right"
              label="操作"
              width="200"
              align="center"
            >
              <el-button
                type="text"
                @click="bindrecod"
              >绑定记录</el-button>
            </el-table-column>
          </el-table>
        </el-col>
      </el-row>
    </div>
    <!-- 绑定记录弹出框 -->
    <el-dialog
      :visible.sync="dialogVisible"
      width="70%"
    >
      <div class="header-title">
        <div
          style="
            padding: 15px 20px;
            color: #fff;
            text-align: center;
            font-weight: bold;
          "
        >
          绑定记录
        </div>
        <div
          class="closeing"
          @click="CloseOne"
        >
          <i class="el-icon-close iconc" />
        </div>
      </div>
      <div>
        <template>
          <el-table
            :data="tableData"
            style="width: 100%"
            :row-class-name="tableRowClassName"
          >
            <el-table-column
              prop="date"
              label="虚拟号"
            />
            <el-table-column
              prop="name"
              label="员工姓名"
            />
            <el-table-column
              prop="address"
              label="员工手机号"
            />
            <el-table-column
              prop="name"
              label="省"
            />
            <el-table-column
              prop="name"
              label="市"
            />
            <el-table-column
              prop="name"
              label="区/县"
            />
            <el-table-column
              prop="name"
              label="所"
            />
            <el-table-column
              prop="name"
              label="操作类型"
            />
            <el-table-column
              prop="name"
              label="时间"
            />
          </el-table>
        </template>
      </div>
      <span
        slot="footer"
        class="dialog-footer"
      >
        <el-button
          type="success"
          @click="confirm"
        >确 定</el-button>
      </span>
    </el-dialog>
  </div>
</template>

<script>
export default {
  name: 'LoginIndex',
  components: {},
  props: {},
  data() {
    return {
      dialogVisible: false,
      options: [
        {
          value: '选项1',
          label: '黄金糕'
        },
        {
          value: '选项2',
          label: '双皮奶'
        }
      ],
      value: '',

      input: '',
      input1: '',
      formInline: {
        user: '',
        region: ''
      },
      tableData: [
        {
          date: '----',
          name: '----',
          address: '----'
        },
        {
          date: '----',
          name: '----',
          address: '----'
        },
        {
          date: '----',
          name: '----',
          address: '----'
        }
      ],
      ruleForm: {
        name: '',
        region: '',
        date1: '',
        date2: '',
        delivery: false,
        type: [],
        resource: '',
        desc: ''
      }
    }
  },
  computed: {},
  watch: {},
  created() {},
  mounted() {},
  methods: {
    bindrecod() {
      this.dialogVisible = true
    },

    // 添加权限关闭事件
    CloseDistribution() {
      this.dialogVisibleDistribution = false
    },
    CloseOne() {
      this.dialogVisible = false
    },
    handleSelectionChange(val) {
      this.multipleSelection = val
      console.log(this.multipleSelection)
    },
    //   编辑按钮点击事件
    edit() {
      this.dialogVisiblebianji = true
    },
    // 增加按钮
    handleClick(row) {
      console.log(row)
      this.dialogVisibleDistribution = true
    },
    //   表格斑马线颜色
    tableRowClassName({ row, rowIndex }) {
      if (rowIndex % 2 == 0) {
        return 'warning-row'
      } else if (rowIndex % 2 == 1) {
        return 'success-row'
      }
      return ''
    }
  }
}
</script>

<style scoped lang="scss">
.table-box {
  width: 100%;
  height: 100px;
}
.login-container {
  margin-top: 50px;
}
.operation {
  display: flex;
  margin: 0 0 10px 0px;
  //   width: 250px;
  height: 50px;
  box-shadow: 1px 1px 3px #01726e;
  //   border-radius: 10px;
}
.header {
  box-shadow: 3px 0px 3px #01726e;
  margin-top: 30px;
  padding-left: 30px;
  padding-top: 15px;
  margin-bottom: 10px;
}
// dialog样式
.closeing {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background-color: #27bdb0;
  position: absolute;
  top: 0px;
  right: -32px;
  opacity: 1;
  .iconc {
    color: #000000;
    display: block;
    width: 30px;
    height: 30px;
    font-size: 20px;
    opacity: 1;
    line-height: 30px;
    text-align: center;
  }
}
.header-title {
  position: absolute;
  width: 100%;
  height: 45px;
  left: 0;
  top: 0;
  background-color: #27bdb0;
}
.closeing:hover {
  background-color: #006f6b !important;
}
</style>
<style>
/* 表格斑马线颜色设置 */
.el-table .warning-row {
  background: #f3fdfc;
}

.el-table .success-row {
  background: #fff;
}
.el-dropdown-link {
  cursor: pointer;
  color: #409eff;
}
.el-icon-arrow-down {
  font-size: 12px;
}
</style>

